<%@page import="com.charlie.sessions.CartLocal"%>
<%@page import="com.charlie.beans.Users"%>
<%@page session="true"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Charlie guitars</title>
        <link rel="stylesheet" href="/resources/css/style.css" type="text/css">
        <link rel="stylesheet" href="/resources/css/validationEngine.jquery.css" type="text/css">
        <script type="text/javascript" src="/resources/js/jquery-2.0.0.min.js"></script>
        <script type="text/javascript" src="/resources/js/cart.js"></script>
        <script type="text/javascript" src="/resources/js/jquery.validationEngine.js"></script>
        <script type="text/javascript" src="/resources/js/jquery.validationEngine-en.js"></script>
        <script type="text/javascript">
            var content_path = '${pageContext.request.contextPath}';
            $(function() {
                $('.disable_on_ckick').click(function() {
                    $(this).hide(100);
                });
            });
        </script>
    </head>
    <body>
        <div class="wrapper">
            <header>
                <div class="header_content">
                    <a href="${pageContext.request.contextPath}"> 
                        <div class="logo"> 
                            <img src="/resources/img/logo.png">
                        </div>
                    </a>
                    <p class="header_right" >
                        <span>
                            <a href="${pageContext.request.contextPath}/cart" class="header_cart">
                                <img src="/resources/img/cart.png">
                                View cart
    <%
        CartLocal cart = (CartLocal) session.getAttribute("cart");
        if (cart != null) {
            out.print("(<span class=\"so_amount\">" + cart.getItemsAmount() + "</span> items)");
        }
    %>
                            </a>
    <%
        Users user = (Users) session.getAttribute("user");
        if (user != null) {
    %>
                        </span>
                        <span>
                            Hi, <a href="${pageContext.request.contextPath}/history">${user.getFirstName()}</a> | 
                            <a href="${pageContext.request.contextPath}/logout">Logout</a>
    <%
        } else {
    %>
                            <a href="${pageContext.request.contextPath}/signin">Sign in</a> | 
                            <a href="${pageContext.request.contextPath}/signup">Register</a>
    <%
        }
    %>
                        </span>
                    </p>
                </div>
            </header>
            <div class="line"> 
            </div>

            <div class="clearfix content">